package com.example.mcpmysqlclient;

import jakarta.annotation.Resource;
import lombok.Builder;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class McpMysqlClientApplication {

    public static void main(String[] args) {
        SpringApplication.run(McpMysqlClientApplication.class, args);
    }

    /**
     * 编写一个工具方法 ChartClient，一方面接收用户传来的参数，另一方面将这个回调工具类和大模型放入到这个chartClient容器中进行交互
     * //传入两个参数一个是 接收用户的请求参数，一个是回调函数对象
     * 告诉LLM有哪些tool
     */
    @Bean
    public ChatClient chatClient(ChatClient.Builder chatClientBuilder , ToolCallbackProvider toolCallbackProvider) {
        return chatClientBuilder.defaultToolCallbacks(toolCallbackProvider).build();

    }



}

